package com.szml.listener;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author limin
 * @date 2025-06-17 16:40
 * @description
 */
@Component
@RocketMQMessageListener(topic = "modelTopic",
        consumerGroup = "mode-consumer-group",
        messageModel = MessageModel.CLUSTERING) //集群模式 负载均衡  //clustering 集群
public class DC1 implements RocketMQListener<MessageExt> {
    @Override
    public void onMessage(MessageExt message) {
        System.out.println("我是mode-consumer-group-a组的第一个消费者:" + message);

    }
}